﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
using Ue.Infrastructure.DomainBase;
using Ue.Infrastructure.Web.UI;
using Ue.Qcdz.Domain;
using Ue.Qcdz.Domain.Permissions;

namespace Ue.Qcdz.UI.Controls.Permission
{
    public class PermissionGridView : SkinnedGridView
    {
        
        private string sinkName = "~/Admin/Themes/Skins/Permission/Permission.ascx";
        protected override string GetSkinFileName()
        {
            return sinkName;
        }
        public PermissionGridView()
        {
            Name = SiteContext.GetSiteContext().Name;
            FeatureName = SiteContext.GetSiteContext().FeatureName;
            Description = SiteContext.GetSiteContext().Description;
        }

        public string Name { get; set; }
        public string FeatureName { get; set; }
        public string Description { get; set; }
        protected override void GridViewDataBind(object sender, EventArgs args)
        {
            //IDataResult<Ue.Qcdz.Domain.Permissions.Permission> dataResult = PermissionsService.GetPermissions(this);
            //Repeater repeater = sender as Repeater;
            //repeater.DataSource = dataResult.DataObjects;
            //repeater.DataBind();
            //this.RecordCount = dataResult.RecordCount;
            Repeater repeater = sender as Repeater;
            repeater.DataSource = PermissionsService.GetPermissions();
            repeater.DataBind();
        }
    }
}
